﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace OnlineEducation.Models.AccountViewModels
{
    public class RegisterViewModel
    {
        [Required(ErrorMessage = "必填")]
        [Display(Name = "用户名")]
        [RegularExpression(@"(^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$)|^1[3456789][0-9]{9}$|(admin)", ErrorMessage = "邮箱格式不正确")]
        public string UserName { get; set; }


        [Required(ErrorMessage = "必填")]
        [StringLength(100, ErrorMessage = "{0}至少{2}位.", MinimumLength = 6)]
        [DataType(DataType.Password)]
        [Display(Name = "密码")]
        public string Password { get; set; }

        [DataType(DataType.Password)]
        [Display(Name = "确认密码")]
        [Compare("Password", ErrorMessage = "两次输入的密码不匹配")]
        public string ConfirmPassword { get; set; }

        [Required(ErrorMessage = "必填")]
        [Display(Name = "验证码")]
        //[StringLength(6, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 3)]
        public string ValidationCode { get; set; }

        [Display(Name = "用户类型")]
        public string UserType { get; set; }
 
    }
}
